package com.example.demo.chap2;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Service4 {

    private Service3 service3;

    @Autowired
    public void injectService3(Service3 service3, @Autowired(required = false) String name) { //@1
        System.out.println(String.format("%s.injectService1(),{service3=%s,name=%s}", this.getClass().getName(), service3, name));
        this.service3 = service3;
    }
    @Override
    public String toString() {
        return "Service3{" +
                "service3=" + service3 +
                '}';
    }
}
